import { shallowEqual, useSelector } from "react-redux"

const useGetRedux = (key) => {
  const redux = useSelector(
    ({ common, persist }) => ({
      test: common.get("test"),
      ...persist
    }),
    shallowEqual
  )
  if (key) {
    return redux[key]
  }
  return redux
}

export default useGetRedux